varying vec3 mynormal;
varying vec4 myvertex;

void main (void) 
{        
	vec3 eyepos = vec3(0,0,0) ; 
	vec4 _mypos = gl_ModelViewMatrix * myvertex ; 
    vec3 mypos = _mypos.xyz / _mypos.w ;

	vec3 normal = normalize(gl_NormalMatrix*mynormal);
	vec3 eyedir = normalize(eyepos - mypos) ;
	float angle = dot(eyedir, normal);

	if ( angle < 0.2 &&  angle >= 0 )
		gl_FragColor = vec4(0,0,0,1);
	else
		gl_FragColor = vec4(1,1,1,1);
}